package com.tanxi521.afkreward.data;

public enum SQLITEStatement {

    CREATE_TABLE("CREATE TABLE if not exists afk_reward (" +
            "id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT," +
            "player_name TEXT," +
            "player_uuid text," +
            "type TEXT," +
            "reward TEXT," +
            "start integer," +
            "end integer," +
            "total integer," +
            "times integer," +
            "today integer DEFAULT 0" +
            ");"),

    INIT_PLAYER("insert into afk_reward(" +
            "player_name," +
            "player_uuid," +
            "type," +
            "reward," +
            "start," +
            "end," +
            "total," +
            "times," +
            "today)" +
            "select ?, ?, ?, ?, ?, ?, ?, ?, ? " +
            "where not exists (" +
            "select player_name from afk_reward " +
            "where player_name = ?)"),

    GET_REST("select today from afk_reward where player_name = ?"),

    START_AFK("update afk_reward SET start=?,end=?,type=?,reward=? where player_name = ?"),

    IS_AFK("select count(0) from afk_reward where player_name = ? and type='未挂机'"),

    PLAYER_INFO("select * from afk_reward where player_name = ?"),

    UPDATE_PLAYER("update afk_reward set type=?,reward=?,start=?,end=?,total=?,times=?,today=? where player_name=?"),

    OFFLINE("update afk_reward set end = ? where type <> '未挂机' and end = 0"),

    PLAYER_EXIT("update afk_reward set end = ? where type <> '未挂机' and end = 0 and player_name = ?"),

    AFK_PLAYERS("select * from afk_reward where type <> '未挂机' limit ?, ?"),

    AFK_COUNT("select count(0) from afk_reward where type <> '未挂机'"),

    AFK_TOP("select * from afk_reward order by total desc limit ?, ?"),

    ALL_COUNT("select count(0) from afk_reward"),

    REPLACE_TODAY("update afk_reward set today=0"),

    ;

    private final String statement;

    SQLITEStatement(String statement) {
        this.statement = statement;
    }

    public String getStatement() {
        return statement;
    }


}
